import { Info } from "@icon-park/react";
import type { ValidationError } from "@tanstack/react-form";
interface Props {
  errors: { message: string }[] | ValidationError[];
}
export const VaildateError = ({ errors }: Props) => {
  if (errors.length === 0) return null;
  return (
    <div className="flex items-center gap-1 bg-gray-900 text-white px-2 py-1 rounded-sm mt-2">
      <Info />
      {errors.map((error, index) => (
        <div key={index}>{error.message}</div>
      ))}
    </div>
  );
};
